<%@ page contentType="text/html; charset=UTF-8"%>
<% response.setHeader("Cache.Control","no-cache"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0);%>

<jsp:useBean id="action" scope="request"
	class="swd.basic.table_name_maintain.Action" />
<jsp:useBean id="view" scope="request"
	class="swd.basic.table_name_maintain.View" />
<jsp:setProperty name="view" property="*" />
<%if (action.action(pageContext).equals("login")){return;} %>
<jsp:useBean id="DataView" scope="request"
	type="com.pub.database.DataView" />
<!-- 以下為DataView 共用設定 -->
<jsp:useBean id="DataViewForm" scope="request"
	type="com.pub.database.DataViewForm" />
<jsp:setProperty name="DataViewForm" property="submitMethod"
	value="POST" />
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="0" />
<jsp:setProperty name="DataViewForm" property="nowPageNum" />
<jsp:setProperty name="DataViewForm" property="dataViewAction" />
<jsp:setProperty name="DataViewForm" property="filterCol" />
<jsp:setProperty name="DataViewForm" property="filterValue" />
<jsp:setProperty name="DataViewForm" property="dvOrderByFields" />
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq" />
<!-- DataView 設定結束 -->
<html>
<head>
<title><%=view.getPrgTitle()%></title>
<LINK HREF="/SWD/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commscript.js"></script>
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commhtmlscript.js"></script>
<SCRIPT type="text/javascript" LANGUAGE="javascript1.2"
	SRC="/SWD/general/swd.js"></SCRIPT>
<SCRIPT type="text/javascript" LANGUAGE="javascript1.2"
	SRC="/SWD/general/pub.js"></SCRIPT>

<script language="javascript" type="">

      function saveRowSn(rowsn){
         if(document.all.item('rowsn').value.indexOf(rowsn)>-1){
            return;//已記錄過就不再記錄了
         }
         if(document.all.item('rowsn').value==''){
           document.all.item('rowsn').value=rowsn;
         } else{
           document.all.item('rowsn').value=document.all.item('rowsn').value + ',' + rowsn;
         }
      }

      function fc_save_before_check(){
         // 檔案編號
         if (document.all.item('dbf_no').value==""){
            alert("檔案編號沒有值!!");
            return;
         }

         // 系統編號
         if (document.all.item('sys_no').value==""){
            alert("系統編號沒有值!!");
            return;
         }

         // 檔案名稱
         if (document.all.item('dbf_name').value==""){
            alert("檔案名稱沒有值!!");
            return;
         }

         document.all.item('prgAction').value='save';
         document.forms[0].submit();
      }

      function fc_save_before_check_all(){
         var L=document.forms[0].elements.length;
         for(i=0;i<L;i++){
            if (document.forms[0].elements[i].name=='dbf_name_g'){
               if(jsf_trim(document.forms[0].elements[i].value)==''){
                     alert("檔案名稱不能為空值!!");
                     return;
               }
            }
            if (document.forms[0].elements[i].name=='sys_no_g'){
               if(jsf_trim(document.forms[0].elements[i].value)==''){
                     alert("系統編號不能為空值!!");
                     return;
               }
            }
         }

         document.all.item('prgAction').value='saveall';
         document.forms[0].submit();
      }
</script>
</head>
<body bgcolor="#ffffff" onload="<%=view.getOnloadScript()%>">
<TABLE BORDER="0" HEIGHT="20" CELLPADDING="0" CELLSPACING="0">
	<TR>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="LEFT"><IMG SRC="/SWD/pub_images/title01.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /><IMG
			SRC="/SWD/pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt="" /></DIV>
		</TD>
		<TD ALIGN="LEFT" HEIGHT="20" VALIGN="MIDDLE"
			BACKGROUND="/SWD/pub_images/title_bg.gif" CLASS="TITLE">步驟2、資料表名稱維護</TD>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="RIGHT"><IMG SRC="/SWD/pub_images/glass.gif"
			WIDTH="12" HEIGHT="8" alt="" /><IMG SRC="/SWD/pub_images/title02.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /></DIV>
		</TD>
	</TR>
</TABLE>
<br />
<form action="<%=request.getRequestURI() %>" method="POST">

<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="0">
	<TR>
		<TD style="" width="5%"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnSaveTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_save_before_check();" /></TD>
		<TD style="" width="5%"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnAddTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='add';document.forms[0].submit();" /></TD>
		<TD style="" width="5%"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnQueryTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='query';document.forms[0].submit();" /></TD>
		<TD style="" width="5%"><INPUT TYPE="BUTTON" VALUE="取消"
			CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='exit';document.forms[0].submit();" /></TD>
		<TD width="80%">&nbsp;</TD>
	</TR>
	<TR>
		<TD colspan=5><font color="red"><%=(view.getTipMessage()!=null ? "工作提示:"+ view.getTipMessage() : "")%></font>
		</TD>
	</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getdbf_noTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="dbf_no" SIZE="25" MAXLENGTH="40"
			VALUE="<%=(view.getdbf_no()!=null ? view.getdbf_no() : "")%>"
			<%=view.getdbf_no_readonly() ? "readonly" : "ondblclick=\"fc_get_table_name(this);\""%>
			CLASS="<%=(view.getdbf_no_readonly() ? "input_noborder" : "input_window hand")%>" />
		</TD>
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getsys_noTitle()%></TD>
		<TD WIDTH="30%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="sys_no" SIZE="8" MAXLENGTH="8"
			VALUE="<%=(view.getsys_no()!=null ? view.getsys_no() : "")%>"
			<%=view.getsys_no_readonly() ? "readonly" : "onDblClick=\"fc_get_sys_data(this);\""%>
			CLASS="<%=(view.getsys_no_readonly() ? "input_noborder" : "input_window hand")%>" />
		</TD>
	</TR>
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><IMG
			SRC="/SWD/pub_images/star.gif" WIDTH="10" HEIGHT="10" HSPACE="2"
			alt="" /><%=view.getdbf_nameTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content" colspan="3"><INPUT
			TYPE="TEXT" NAME="dbf_name" SIZE="50" MAXLENGTH="40"
			VALUE="<%=(view.getdbf_name()!=null ? view.getdbf_name() : "")%>"
			<%=view.getdbf_name_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getdbf_name_readonly() ? "input_noborder" : "input")%>" />
		</TD>
	</tr>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="prgAction" VALUE="<%=view.getPrgAction()%>" />
<INPUT TYPE="HIDDEN" NAME="prgStatus" VALUE="<%=view.getPrgStatus()%>" />
<INPUT TYPE="HIDDEN" NAME="flowAction" VALUE="<%=view.getFlowAction()%>" />
<INPUT TYPE="HIDDEN" NAME="flowStatus" VALUE="<%=view.getFlowStatus()%>" />
<br />
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">

	<tr>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnSaveAllTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_save_before_check_all();" /></TD>
	</tr>
	<tr>
		<td>
		<% //if ((view.getdbf_no() == null || view.getdbf_no().equals(""))) {
       // return;
   //  } else {

       DataView.OutputDataView(DataViewForm, pageContext);
  //   }  %>
		</td>
	</tr>
</TABLE>
</form>
</body>
</html>
